;; Sri Ganeshji : Sri Balaji : Sri Pitreshwarji : Sri Durgaji : Sri Venkateshwara

/*
Objective(s) -
-	This code demonstrates the usage of Form Level Page Break which are used to define
	Closing Parts in the previous pages and Opening Parts in the subsequent pages.

Last modification -
-	Altered on 09-11-2009
*/

[Report: Form Pgbk Trial Balance Report]

	Title		: $$LocaleString:"Trial Balance"
	Form		: Form Pgbk Trial Balance

	Repeat      : SVCurrentCompany, SVFromDate, SVToDate
	ColumnReport: MyMultiColumns

	Variable	: Form Pgbk TB Group, IsLedgerWise, SVPeriodicity

    PrintSet    : Report Title      : $$LocaleString:"Trial Balance"
    Set         : IsLedgerWise      : No

[Form: Form Pgbk Trial Balance]
    
    Buttons     : F2ChangePeriod, ChangeCompany, LedgerWiseButton
	Keys        : ChangePeriod
	
;;To incorporate the change in TallyPrime
	Bottom Button	: Add Column, Alter Column, Delete Column
	
	BottomButton: MyAutoButton, BlankButton, InvReports, AcctReports, ReportOperations, FilterButton, ValueButton
	Buttons		: PrintButton, ExportButton, UploadButton, MailButton
	Parts		: Form Pgbk TB Title, Form Pgbk TB Details
	Page Break  : DSP ClPageBreak, Form Pgbk TB OpPgPart
	Height		: 100% Page
	Width		: 100% Page
	Background	: Released Pale Yellow
	Option		: Prn Form Pgbk TB	: $$InPrintMode
	
	[!Form: Prn Form Pgbk TB]
	
        Add         : Parts     : At Beginning  : DSP CompanyName, DSP CompanyAddress, DSP ReportTitle
   		Space Left	: 0.25 inch
   		
;; For enabling Titles during Printing, Form Level Optional parts 
;; Company Name, Address and Report Title are used from defTDL.
       
    [Part: Form Pgbk TB OpPgPart]
    
        Parts       : DSP CompanyName, DSP CompanyAddress, DSP ReportTitle, Form Pgbk TB Title
        Vertical    : Yes

;; Every continuous page should have the above parts during Printing

	[Part: Form Pgbk TB Title]

		Lines		: Form Pgbk TB Title1, Form Pgbk TB Title2, Form Pgbk TB Title3, Form Pgbk TB STitle
		Border      : Thin Top

		[Line: Form Pgbk TB Title1]

			Use			: Form Pgbk TB Title3
			Local		: Field		: Name Field		    : Set as		: ""
			Local		: Field		: Form Pgbk TB DrAmt Field	: Set as		: @@CmpMailName
			Local		: Field		: Form Pgbk TB DrAmt Field	: Lines			: 0
			Local		: Field		: Form Pgbk TB DrAmt Field	: Border		: Thin Left
			Invisible   : $$IsCommon:SVCurrentCompany AND $$InPrintMode
			
;; This Line is made Invisible in Print Mode only if Columns selected
;; are of single company

		[Line: Form Pgbk TB Title2]

			Use			: Form Pgbk TB Title3
			Local		: Field		: Default		    	: Style			: Normal
			Local		: Field		: Name Field		    : Set as		: $$LocaleString:"Particulars"
			Local		: Field		: Name Field		    : Style			: Normal Bold
			Local		: Field		: Name Field	    	: WideSpaced	: Yes
			Local		: Field		: Form Pgbk TB DrAmt Field	: Set as		: @@DSPDateStr
			Local		: Field		: Form Pgbk TB DrAmt Field	: Border		: Left Full Thin Bottom
			
;; DSPFDateStr is the Default Formula which displays the values 
;; present in both the date variables - SVFromDate & SVTodate 

		[Line: Form Pgbk TB Title3]

			Fields		: Name Field, Form Pgbk TB DrAmt Field
			Local		: Field		: Default			    : Type			: String
			Local		: Field		: Name Field		    : Set as		: ""
			Local		: Field		: Name Field		    : Align			: Center
			Local		: Field		: Form Pgbk TB DrAmt Field	: Align			: Centre
			Local		: Field		: Form Pgbk TB DrAmt Field	: Border		: Left Full Thin Bottom
			Local		: Field		: Form Pgbk TB DrAmt Field	: Set as		: $$LocaleString:"Closing Balance"
			Repeat		: Form Pgbk TB DrAmt Field

		[Line: Form Pgbk TB STitle]

			Fields		: Name Field, Form Pgbk TB Amount Field
			Local		: Field		: Default			    : Style			: Normal
			Local		: Field		: Default			    : Align			: Centre
			Local		: Field		: Default			    : Type			: String
			Local		: Field		: Name Field		    : Set as		: ""
			Local		: Field		: Form Pgbk TB DrAmt Field	: Set as		: $$LocaleString:"Debit"
			Local		: Field		: Form Pgbk TB CrAmt Field	: Set as		: $$LocaleString:"Credit"
			Local		: Field		: Form Pgbk TB CrAmt Field	: Border		: Thin Left
			Repeat		: Form Pgbk TB Amount Field
			Border		: Thin Bottom
			
	[Part: Form Pgbk TB Details]

		Lines		: Form Pgbk TB Details
		BottomLines	: Form Pgbk TB Total
		Repeat		: Form Pgbk TB Details	: Form Pgbk TB GroupLed
		Total		: Form Pgbk TB DrAmt Field, Form Pgbk TB CrAmt Field
		Scroll		: Vertical
		CommonBorder: Yes
		Float		: Yes
		
        Option      : Form Pgbk TB Details Led : ##IsLedgerWise
      
        [!Part: Form Pgbk TB Details Led]

		    Repeat		: Form Pgbk TB Details	: Form Pgbk TB Led
		    Local       : Collection: Form Pgbk TB Led         : BelongsTo     : Yes
                   
		[Line: Form Pgbk TB Details]

			Fields		: Form Pgbk TB Name Field, Form Pgbk TB Amount Field
			Local		: Field		: Form Pgbk TB Name Field	: Set as		: $$Name
			Local		: Field		: Form Pgbk TB DrAmt Field	: Set as		: if $$IsDr:$ClosingBalance then $ClosingBalance else 0
			Local		: Field		: Form Pgbk TB CrAmt Field	: Set as		: if $$IsDr:$ClosingBalance then 0 else $ClosingBalance
			Repeat		: Form Pgbk TB Amount Field

			[Field: Form Pgbk TB Name Field]

				Use			: Name Field
				Variable	: Form Pgbk TB Group
				Display		: Form Pgbk Trial Balance Report		: $$IsGroup
				Option		: Form Pgbk TB LedName Field	: $$IsLedger

				[!Field: Form Pgbk TB LedName Field]

					Variable	: LedgerName
					Display		: Ledger Monthly Summary
					Style       : Normal Italic

			[Field: Form Pgbk TB Amount Field]

				Fields		: Form Pgbk TB DrAmt Field, Form Pgbk TB CrAmt Field
				Border		: Thin Left
				Display		: Form Pgbk Trial Balance Report: $$IsGroup
				Display		: Ledger Monthly Summary    : $$IsLedger
			    			    
				[Field: Form Pgbk TB DrAmt Field]

					Use			: Amount Field
					Style       : Normal

				[Field: Form Pgbk TB CrAmt Field]

					Use			: Amount Field
					Style       : Normal

			[Collection: Form Pgbk TB GroupLed]
			
				Collection	: Form Pgbk TB Group, Form Pgbk TB Led
			
			[Collection: Form Pgbk TB Group]
			
				Type		: Group
				Child Of	: ##FormPgbkTBGroup
				Filter		: NoProfit
				Fetch		: Name, ClosingBalance

				
			[Collection: Form Pgbk TB Led]
			
				Type		: Ledger
				Child Of	: ##FormPgbkTBGroup
				Filter		: NoProfit
				Fetch		: Name, ClosingBalance

			[Variable: Form Pgbk TB Group]
			
				Type		: String
				Default     : ""
				Volatile	: Yes
	
			[System: Formula]
				NoProfit	: NOT $$IsLedgerProfit AND $ClosingBalance > 0

    	[Line: Form Pgbk TB Total]

			Use			: Form Pgbk TB Details
			Local       : Field     : Default               : Style         : Normal Bold
			Local		: Field		: Form Pgbk TB Name Field	: Set as		: "GRAND TOTAL"
			Local       : Field     : Form Pgbk TB Name Field	: WideSpaced    : Yes
			Local		: Field		: Form Pgbk TB Name Field	: Align			: Centre
			Local		: Field		: Form Pgbk TB DrAmt Field	: Set as		: $$Total:FormPgbkTBDrAmtField
			Local		: Field		: Form Pgbk TB CrAmt Field	: Set as		: $$Total:FormPgbkTBCrAmtField
			Border		: Flush Totals
			Fixed		: Yes
			Space Top   : 1

;; End-of-File
